<!--
<template>
    <div class="list">
        <el-table
            :data="voteList"
            style="width: 95%">
            <el-table-column
                prop="name"
                label="管理人"
                width="230">
            </el-table-column>
            <el-table-column
                prop="votes"
                label="票数"
                width="">
            </el-table-column>
        </el-table>

        <div class="page">
            <el-pagination
                layout="prev, pager, next"
                @current-change="handleCurrentChange"
                :total="count">
            </el-pagination>
        </div>
    </div>
</template>

<script>
    import util from 'assets/js/util.js'

    export default {
        data () {
            return {
                voteList: [],
                count: 0,
                caseId: 0,
                creditorId: 0
            }
        },
        methods: {
            handleCurrentChange: function (page) {
                this.voteList.splice(0, this.voteList.length);

                const _self = this;
                util.ajax({
                    url: '/' + this.caseId + '/' + +this.creditorId + `/committeeInfo/electedInfo`,
                    params: {page: page, size:10},
                    success: function (data) {
                        _self.voteList.splice(0, _self.voteList.length);
                        data.forEach(_vote => _self.voteList.push({
                            name: _vote.name,
                            votes: _vote.votes
                        }));
                        _self.count =data.count
                    },
                });
            }
        },
        mounted () {
            this.caseId = util.getUrlParam(document.location.href, 'caseId');
            this.creditorId = util.getUrlParam(document.location.href, 'creditorId');

            const _self = this;
            util.ajax({
                url: '/' + this.caseId + '/' + +this.creditorId + `/committeeInfo/electedInfo`,
                params: {page: 0, size:10},
                success: function (data) {
                    data.forEach(_vote => _self.voteList.push({
                        name: _vote.name,
                        votes: _vote.votes
                    }));
                    _self.count =data.count
                },
            });
        }
    }
</script>

<style scoped>
    .list {
        line-height: 50px;
    }

    .page {
        text-align: center;
        position: fixed;
        bottom: 10%;
        left: 0;
        right: 0;
        width: 100%;
    }

</style>
-->
